/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import AO.Company;
import dbconnector.DBDriver;
import java.sql.PreparedStatement;


/**
 *
 * @author FRIENDS
 */
public class CompanyDAO 
{

    
     public static boolean save(Company c) throws Exception
  {
    try
    {
        {
           
      PreparedStatement pstmt = DBDriver.getPrepare("insert into companydetails values(?,?,?,?,?,?,?,?)");
      pstmt.setString(1, c.getCname());
      pstmt.setString(2, c.getCaddress());
      pstmt.setString(3, c.getCfield());
      pstmt.setInt(4, c.getCutoff());
      pstmt.setString(5, c.getCemail());
      pstmt.setString(6, c.getCcontact());
      pstmt.setString(7, c.getCusername());
      pstmt.setString(8, c.getCpassword());
      
      int i=pstmt.executeUpdate();
      if(i==1)
          return true;
    }
    
    
  }
     catch (Exception e) {
         
         e.printStackTrace();
        return false;
    }
    return false;
  }
     
     
     

}
